// 引入request封装的axios
import request from '@/utils/request'

/**
 *@description 查询企业的部门列表
 */
export const getDepartmentsApi = () => request({
  url: '/company/department'
})

/**
 * @description 获取员工简单列表
 */
export const getASimpleListOfEmployeesApi = () => request({
  url: '/sys/user/simple'
})

/**
 * @description 新增部门
 * @param {*} data
 */
export const addDepartmentApi = (data) => request({
  url: '/company/department',
  method: 'POST',
  data
})

/**
 * @description 根据ID查询部门详情
 * @param {*} id 部门id
 */
export const getDepartmentDetailsApi = (id) => request({
  url: `/company/department/${id}`
})

/**
 *@description 根据ID修改部门详情
 * @param {*} id  部门id
 */
export const editDepartmentDetailsApi = (data) => request({
  url: `/company/department/${data.id}`,
  method: 'PUT',
  data
})

/**
 * 根据ID删除部门
 * @param {部门id} id
 */
export const deleteDepartmentApi = (id) => request({
  url: `/company/department/${id}`,
  method: 'DELETE'
})

